import os
from langchain_openai import ChatOpenAI
from langchain.schema import HumanMessage, SystemMessage

os.environ["OPENAI_API_KEY"] = 'sk-f2M0jWxDEb7IJKiuCnMsvKE7TLSYCA36pyl8gWA1XLaHnD8l'
os.environ["OPENAI_BASE_URL"] = 'https://api.f2gpt.com/v1'

chat = ChatOpenAI(
    model='gpt-4',
    temperature=0.8,
    max_tokens=600
)

messages = [
    SystemMessage(content="你是花店工作者"),
    HumanMessage(content="请给我的花店起个名"),
]
response = chat(messages)
print(response.content)
